<template>
  <div class="user-info-container">
    <div class="container">
      <el-form label-width="180px">
        <el-form-item label="姓名">
          <el-input disabled v-model="form.user_name"></el-input>
        </el-form-item>
        <el-form-item label="登录用户名">
          <el-input disabled v-model="form.login_name"></el-input>
        </el-form-item>
        <el-form-item label="性别">
          <el-input disabled v-model="form.sex"></el-input>
        </el-form-item>
        <el-form-item label="角色">
          <el-input disabled v-model="form.type"></el-input>
        </el-form-item>
        <el-form-item label="工号">
          <el-input disabled v-model="form.user_no"></el-input>
        </el-form-item>
        <el-form-item label="邮箱">
          <el-input disabled v-model="form.email"></el-input>
        </el-form-item>
        <el-form-item label="部门">
          <el-input disabled v-model="form.dept_name"></el-input>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>

export default {
  data() {
    return {
      form: {},
    };
  },
  methods: {
    init() {
      const userString = localStorage.getItem("userInfo");
      if (userString) {
        const userInfo = JSON.parse(userString);
        this.form = { ...userInfo, sex: userInfo.sex == "1" ? "男" : "女", type: '员工' };
      }
    },
  },
  created() {
    this.init();
  },
};
</script>

<style lang="scss" scoped>
.user-info-container {
  width: 100%;
  height: 100%;
  padding: 30px 20px 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  .container {
    width: 800px;
  }
}
</style>
